import os

def mkwalker(dir_structure):
    def walker(dir):
        ds_fs = dir_structure.get(dir)
        if ds_fs:
            ds, fs = ds_fs
            yield dir, ds, fs
            for dn in ds:
                for x in walker('{0}/{1}'.format(dir, dn)):
                    yield x
    return walker

